package edu.spec.dengyan.week02.class03;

public class TestMatrix {
    public static void main(String[] args){
        int[][] a={{1,2,3,4},{5,6,7,8},{9,1,2,3}};
        int[][] b={{1,2},{3,4},{5,6},{7,8}};
        int arow=a.length;
        int bcol=b[0].length;
        int m=b.length;
        int[][] c=new int[arow][bcol];
        for(int i=0;i<arow;i++){
            for(int j=0;j<bcol;j++){
                int result=0;
                for(int k=0;k<m;k++){
                    result+=a[i][k]*b[k][j];
                }
                c[i][j]=result;
            }
        }
        for(int i=0;i<c.length;i++){
            for(int j=0;j<c[i].length;j++){
                System.out.print(c[i][j]+"\t");
            }
            System.out.println();
        }
    }
}
